#ifndef NOSAL_EXEC_INTERNAL_REDIRECT_PROCESS_OUTPUT_H_
#define NOSAL_EXEC_INTERNAL_REDIRECT_PROCESS_OUTPUT_H_

namespace netaos {
namespace nosal {
namespace exec {
namespace internal {

/// @brief Redirects the running process terminal output
///
/// This call will call mkdir to create /var/redirected if it doesn't exist,
/// then it calls dup2 to replace the stdout and stderr descriptors with a
/// file descriptor to /var/redirected/<fileName> opened with a call to
/// open.
///
/// @param fileName output file name
void RedirectProcessOutput(const char* const fileName);

}  // namespace internal
}  // namespace exec
}  // namespace nosal
}  // namespace netaos

#endif  // NOSAL_EXEC_INTERNAL_REDIRECT_PROCESS_OUTPUT_H_
